﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Admin_MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Session["TenDangNhap_NhanVien"] != null)
            {
                lbt_ThongTinCaNhan.Text = Session["TenNhanVien"].ToString();
                if (Session["MaPhanQuyen"].ToString() == "0")
                {
                    li_nv.Visible = true;
                    li_kh.Visible = true;
                }
                else
                {
                    li_nv.Visible = false;
                    li_kh.Visible = false;
                }
            }
            else
            {
                lbt_ThongTinCaNhan.Text = "";
                Response.Redirect("DangNhap.aspx");
            }
        }
        catch
        {
            Response.Redirect("DangNhap.aspx");
        }
    }
    protected void lbt_Thoat_Click(object sender, EventArgs e)
    {
        lbt_ThongTinCaNhan.Text = "";
        Session["TenDangNhap_NhanVien"] = null;
        Session["MaPhanQuyen"] = null;
        Session["TenNhanVien"] = null;
        Response.Redirect("DangNhap.aspx");
    }
    protected void lbt_DoiMatKhau_Click(object sender, EventArgs e)
    {
        Response.Redirect("NhanVien_DoiMatKhau.aspx?id=" + Session["TenDangNhap_NhanVien"].ToString());
    }
}
